const components = {}

const requireComponent = require.context(`${process.env.VUE_APP_BuildProjectType === 'mobile' ? './vants' : '.'}`, true, /\.vue$/)
requireComponent.keys().forEach((fileName) => {
  const componentOptions = requireComponent(fileName)
  const component = componentOptions.default || componentOptions
  components[component.name] = component
})

export default components
